import NProgress from 'nprogress' // progress bar
import router from './routers/index'
import 'nprogress/nprogress.css'
// 进度环显示隐藏 - 右上角
NProgress.configure({ showSpinner: true }) // NProgress Configuration

router.beforeEach((to, from, next) => {
  NProgress.start() // start progress bar
  console.log('beforeEach：to = ', to, 'from = ', from)
  next()
})

router.afterEach((to, from) => {
  NProgress.done() // finish progress bar
  console.log('afterEach：to = ', to, 'from = ', from)
})

export default router
